{extends file='main.tpl'}

{block name="title"}
  <title>Listar usuarios</title>
{/block}

{block name="content"}
  <a href="users.php?page=create">Crear nuevo</a>
  <!-- Table maintanances -->
  <table>
    <tr>
      <th>Name</th>
      <th>Rol</th>
      <th>¿habilitado?</th>
      <th>Se creó en</th>
    </tr>
    {foreach key=key item=item from=$users}
      <tr>

        <td>{$item.name}</td>

        {if $item.rol=='1'}
          <td>Cliente</td>
        {/if}
        {if $item.rol=='0'}
          <td>Admin</td>
        {/if}

        {if $item.softDelete=='1'}
          <td>No</td>
        {/if}
        {if $item.softDelete=='0'}
          <td>Si</td>
        {/if}

        <td>
          {$item.createdAt|date_format:"%d/%m/%y"} {$item.createdAt|date_format:"%I:%M%p"}
        </td>
        <td>
          <a href="users.php?page=update&id={$item.id}&update=0">
            ✎
          </a>
        </td>
      </tr>
    {/foreach}
  </table>
{/block}